'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 开服7天
 * @author sundbcn@gmail.com (sun debing)
 */

var modelUtil = require('../util/modelUtil');
var mongoConnector = require('../libs/mongodb/mongoConnector');
/* jshint unused:false */
var sevenDayActivitySchema = require('../schemas/sevenDayActivitySchema.js');
var SevenDayActivity = mongoConnector().model('SevenDayActivity');
var constantUtil = require('../util/constantUtil');

/**
 * 开服7天
 */
module.exports.getByRoleId = function (role_id, cb) {
    modelUtil.getByRoleId(SevenDayActivity, role_id, function (err, seven_day_model) {
        if (!!err) {
            console.error(err);
            return cb(err);
        }

        cb(null, seven_day_model);
    });
};

/**
 * 5点刷新
 */
module.exports.onFiveRefresh = function (self, cb) {
    self.refreshFollowTask();
    cb();
};
